﻿using System.Collections;
using System.Runtime.Serialization;

using zijian666.Converts.Abstractions;

namespace zijian666.Converts.Dynamic;

internal class DynamicEnumerator : DynamicEntity, IObjectReference, IEnumerator//, IObjectHandle, ICustomTypeProvider
{
    private readonly IEnumerator _enumerator;

    public DynamicEnumerator(IEnumerator enumerator, IConvertSettings convertSettings)
        : base(enumerator, convertSettings) => _enumerator = enumerator ?? throw new System.ArgumentNullException(nameof(enumerator));

    public object Current => CreateDynamic(_enumerator.Current);

    public bool MoveNext() => _enumerator.MoveNext();

    public void Reset() => _enumerator.Reset();

}
